<%-- 
    Document   : incluir
    Created on : 12-feb-2012, 18:35:04
    Author     : marco
--%>

<%@page import="java.io.File"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript">
            function check() {
                var ruta = document.f.pic.value;
                extension = ruta.substring(ruta.indexOf('.',0),ruta.length-1);
                extension = extension.toLowerCase();
                if(extension != '.part') {
                    document.f.RUTA.value = ruta.toString();
                    alert('Ha seleccionado un fichero '+extension+
                        ' ; indique un fichero tipo part en su lugar');
                    return false; }
                else
                {
                    
                    return true;
                } 
            }
        </script>
        
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="control" enctype="multipart/form-data" name="f" method="post" onsubmit="return check();" >
            <p>
                Fichero a incluir:<br>
                <input type="file" name="pic" accept="text/*" >
            </p>
            <div>
                <input type="submit" value="Indexar">
            </div>
        </form>
        <a href="buscador.jsp">Buscador</a><br>
    </body>
</html>
